home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7180 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.lang.c,comp.graphics.algorithms,rec.games.programmer
  4. Subject: Re: Speed question here...
  5. Date: 16 Feb 96 12:16:19 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.824472979@rscernix>
  8. References: <4ftluh$1gkv@hearst.cac.psu.edu> <4fvjqnINN84p@keats.ugrad.cs.ubc.ca>
  9. NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <4fvjqnINN84p@keats.ugrad.cs.ubc.ca> c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) writes:
  13.  
  14. >In article <4ftluh$1gkv@hearst.cac.psu.edu>,
  15. >William Koscho <koscho@wjk130.rh.psu.edu> wrote:
  16. >>I was curious as to how fast something like the 
  17. >>following would execute:
  18. >
  19. >I don't know? How fast can your compiler tell you that the program can't be
  20. >compiled?
  21. >
  22. >>    int x;
  23. >>    node *ptr;   ptr in linked list
  24. >>
  25. >>       for ( ptr = first_node; ptr != NULL; ptr = ptr.next ) {
  26. >
  27. >You don't dereference pointers by doing ptr.field. You use *(ptr).field, or,
  28.  
  29. You misspelled (*ptr).field.  *(ptr).field is the same as *ptr.field and
  30. both are illegal because the dot operator has higher precedence.
  31.  
  32. Dan
  33. --
  34. Dan Pop
  35. CERN, CN Division
  36. Email: danpop@mail.cern.ch 
  37. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  38.